//---------------------------------------------------------------------------

#ifndef TCurveH
#define TCurveH

#include <vector.h>
#include <Graphics.hpp>
#include "TIO.h"
#include "TElementSerialNumber.h"
#include "AdvListV.hpp"
#include "AdvGrid.hpp"
//---------------------------------------------------------------------------

class TCurve : public TElementSerialNumber
{
private:
   bool Init;

   float FLength;
   float FRadii;
   float FAngle;       //Todo 2 -o Li Wenjian : Does it need change to another.

   float FBegin;
   float FEnd;

   bool FDirection;
protected:
public:
	float Grade;
	float ioBegin, ioEnd;

   __property float Length  = { read=FLength, write=FLength };
   __property float Radii = { read=FRadii, write=FRadii };
   __property float Angle = { read=FAngle, write=FAngle };
   __property bool Direction = { read=FDirection, write=FDirection };

   __property float Begin = { read=FBegin, write=FBegin };
   __property float End = { read=FEnd, write=FEnd };

   __fastcall TCurve();
	bool __fastcall Initialize(const TMeasurementRate MeasurementRate);

   TCurve & __fastcall operator = (const TCurve & t);

   void __fastcall Load(const int Handle);
   void __fastcall Save(const int Handle);
};

//---------------------------------------------------------------------------
class TCurves : public vector<TCurve>
{
private:
protected:
public:
	TItemCaption BeginPositionCaption, EndPositionCaption;
	TCurves & __fastcall operator = (const TCurves & t);
	__fastcall TCurves();
	bool __fastcall VerifyInput(const AnsiString BeginText, const AnsiString EndText, const AnsiString AngleText);
	bool __fastcall Initialize(const TMeasurementRate MeasurementRate);
	void __fastcall Add(const TCurve Curve);
	void __fastcall Add(const float Length, const float Grade, const float Radii);
	void __fastcall Delete(const int p);
	TCurve __fastcall FindCurve(const AnsiString SerialNumber);
	void __fastcall Load(const int Handle);
	void __fastcall Save(const int Handle);
	void __fastcall ResetIndex(void);
	TCurve __fastcall Find(const AnsiString SerialNumber);
	void __fastcall WriteListView(TListView *ListView);
	void __fastcall WriteAdvListView(TAdvListView * AdvListView);
	void __fastcall WriteAdvStringGrid(TAdvStringGrid * AdvStringGrid);
	void __fastcall ReadAdvStringGrid(TAdvStringGrid * AdvStringGrid);
	void __fastcall Draw(TCanvas *Canvas, const int Base, const float Scale,
								const int BeginPos, const int EndPos, const int Height);
};

class TCurvesList : public vector<TCurves>
{

};



#endif
